package com.teradyne.merlin2.ui.client;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.teradyne.merlin2.ui.client.views.AppLayout;

/**
 * This class is responsible for ActivityManager instantiations through GIN, it
 * also associate every ActivityManager with the corresponding display region
 */
public class ActivityManagerInitializer {

	@Inject
	public ActivityManagerInitializer(
			AppLayout appPanelView,
			@Named("BottomRegion") ActivityManager bottomActivityMapper,
			@Named("LeftSideRegion") ActivityManager leftSideActivityMapper,
			@Named("RightSideRegion") ActivityManager rightSideActivityMapper,
			@Named("CenterContentRegion") ActivityManager centerContentActivityManager,
			@Named("TopRegion") ActivityManager topContentActivityManager) {
		bottomActivityMapper.setDisplay(appPanelView
				.getBottomContainer());
		leftSideActivityMapper.setDisplay(appPanelView
				.getLeftSideContainer());
		rightSideActivityMapper.setDisplay(appPanelView
				.getRightSideContainer());
		centerContentActivityManager.setDisplay(appPanelView
				.getCenterContainer());
		topContentActivityManager.setDisplay(appPanelView.getTopContainer());
	}

}
